package com.M10.BE.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.widget.TextView;

import com.M10.BE.R;
import com.fn.useries.model.Asset;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author LuoDaHai
 * @decs 资产详情
 * @time 2018/3/8   8:51
 */
public class AssetInfoActivity extends Activity {

    @BindView(R.id.tv_asset_info_back)
    TextView tvAssetInfoBack;
    @BindView(R.id.tv_asset_info_htm)
    TextView tvAssetInfoHtm;
    @BindView(R.id.tv_asset_info_rkdh)
    TextView tvAssetInfoRkdh;
    @BindView(R.id.tv_asset_info_zcmc)
    TextView tvAssetInfoZcmc;
    @BindView(R.id.tv_asset_info_cztlx)
    TextView tvAssetInfoCztlx;
    @BindView(R.id.tv_asset_info_jyblx)
    TextView tvAssetInfoJyblx;
    @BindView(R.id.tv_asset_info_jldw)
    TextView tvAssetInfoJldw;
    @BindView(R.id.tv_asset_info_sl)
    TextView tvAssetInfoSl;
    @BindView(R.id.tv_asset_info_dj)
    TextView tvAssetInfoDj;
    @BindView(R.id.tv_asset_info_zj)
    TextView tvAssetInfoZj;
    @BindView(R.id.tv_asset_info_ggxh)
    TextView tvAssetInfoGgxh;
    @BindView(R.id.tv_asset_info_qdrq)
    TextView tvAssetInfoQdrq;
    @BindView(R.id.tv_asset_info_qdfs)
    TextView tvAssetInfoQdfs;
    @BindView(R.id.tv_asset_info_syzk)
    TextView tvAssetInfoSyzk;
    @BindView(R.id.tv_asset_info_syfx)
    TextView tvAssetInfoSyfx;
    @BindView(R.id.tv_asset_info_cgzzxs)
    TextView tvAssetInfoCgzzxs;
    @BindView(R.id.tv_asset_info_trsyrq)
    TextView tvAssetInfoTrsyrq;
    @BindView(R.id.tv_asset_info_yjsynx)
    TextView tvAssetInfoYjsynx;
    @BindView(R.id.tv_asset_info_bxjzrq)
    TextView tvAssetInfoBxjzrq;
    @BindView(R.id.tv_asset_info_sybm)
    TextView tvAssetInfoSybm;
    @BindView(R.id.tv_asset_info_syry)
    TextView tvAssetInfoSyry;
    @BindView(R.id.tv_asset_info_cfdd)
    TextView tvAssetInfoCfdd;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_asset_info);
        ButterKnife.bind(this);
        Asset asset = (Asset) getIntent().getSerializableExtra("asset");
        tvAssetInfoHtm.setText(asset.getContractId());
        tvAssetInfoRkdh.setText(asset.getName());
        tvAssetInfoZcmc.setText(asset.getName());
        tvAssetInfoCztlx.setText(asset.getCzType());
        tvAssetInfoJyblx.setText(asset.getJyType());
        tvAssetInfoJldw.setText(asset.getJldw());
        tvAssetInfoSl.setText(asset.getCnum());
        tvAssetInfoDj.setText(asset.getUnitPrice());
        tvAssetInfoZj.setText(asset.getWorth().toString());
        tvAssetInfoGgxh.setText(asset.getModel());
        tvAssetInfoQdrq.setText(asset.getTakeDate());
        tvAssetInfoQdfs.setText(asset.getTakeWay());
        tvAssetInfoSyzk.setText(asset.getUseStatus());
        tvAssetInfoSyfx.setText(asset.getUseDir());
        tvAssetInfoCgzzxs.setText(asset.getCgzzxsid());
        tvAssetInfoTrsyrq.setText(asset.getAvailableDate());
        tvAssetInfoYjsynx.setText(asset.getEulMonth());
        tvAssetInfoBxjzrq.setText(asset.getTwaDate());
        tvAssetInfoSybm.setText(asset.getUseOrg());
        tvAssetInfoSyry.setText(asset.getUseUser());
        tvAssetInfoCfdd.setText(asset.getPlaceId());
    }

    @OnClick(R.id.tv_asset_info_back)
    public void onViewClicked() {
        finish();
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            finish();
        }
        return super.onKeyDown(keyCode, event);
    }
}
